/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-03-07
 * Time: 13:00
 */
public class Main {
    public static void main(String[] args) throws InterruptedException {
        MyThreadPoolExecutor executor = new MyThreadPoolExecutor(4);
        executor.getList().forEach(System.out::println);
        for (int i = 0; i < executor.getCapacity(); i++) {
            //事实final
            int n = i;
            executor.submit(()-> System.out.println("执行任务: " + n + "    当前线程: " + Thread.currentThread().getName()));
        }
    }
}